package cn.stylefeng.guns.czlm.mapper;

import cn.stylefeng.guns.czlm.entity.TbCategory;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Lists;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * 类目mapper接口
 */
public interface TbCategoryMapper extends BaseMapper<TbCategory> {

    /**
     * 分页查询，显示数据
     * @param page
     * @return
     */
    Page<Map<String, Object>>findTbCategoryAll(@Param("page") Page page);

    /**
     * 添加类目方法
     * @param tbCategory
     * @return
     */
    public int addCat(TbCategory tbCategory);


    /**
     * 查询类目级别为1
     * @param
     * @return
     */
    List<TbCategory> upLevelList();

    /**
     * 查询类目级别为2
     * @param
     * @return
     */
    List<TbCategory> upLevelLists();

    /**
     * 查询商品数量
     * @param
     * @return
     */
    List<Lists> Lists();

    @Select("select * from tb_category")
    List<TbCategory> TbCategoryList();
}
